<template>
  <div class="Header">
    <!-- <v-row style="color: white">
      <v-col class="pt-1" cols="5" style="font-size:1rem;">
        <i class="el-icon-apple pl-4"></i>
        <span class="pl-2">东南大学</span>
        <i class="el-icon-caret-bottom pl-2"></i>
      </v-col>
      <v-col class="pt-2 text-center" style="font-size:1rem;font-weight: 600;" cols="2">{{title}}</v-col>
      <v-col cols="5" class="pt-1 text-right" style="font-size:1rem;">
        <span class="">{{ time }}</span>
        <i class="el-icon-apple pl-4"></i>
        <i class="el-icon-apple pl-4"></i>
        <i style="cursor:pointer"  class="el-icon-minus pl-4" @click="minus"></i>
        <i style="cursor:pointer"  class="el-icon-close px-4" @click="close"></i>
      </v-col>
    </v-row> -->
    <div style="height: 38px"></div>
    <img src="./img/header.png">
    <!-- <div class="bg"></div> -->
  </div>
</template>
<script>
/* eslint-disable */
/**
 * Header 系统 - 头部公共组件
 *
 * 参数
 * String title 头部标题 默认 空
 *
 */
export default {
  props: {
    title: {
      type: String,
      default: "标题",
    }
  },
  data: () => ({
    time: ''
  }),
  created(){
    this.getTime()
    setInterval(() => {this.getTime()}, 1000);
  },
  methods: {
    close(){ this.$C.shutdownSystem() },
    minus(){ this.$C.loadMapPage() },
    getTime() {
      const date = new Date();
      const year = date.getFullYear();
      let month = date.getMonth() + 1;
      let day = date.getDate();
      let hours = date.getHours();
      let minutes = date.getMinutes();
      let seconds = date.getSeconds();
      month = (month + '').length === 1 ? '0' + month : month
      day = (day + '').length === 1 ? '0' + day : day
      hours = (hours + '').length === 1 ? '0' + hours : hours
      minutes = (minutes + '').length === 1 ? '0' + minutes : minutes
      seconds = (seconds + '').length === 1 ? '0' + seconds : seconds
      this.time = year + "-" + month + "-" + day + "  " + hours + ":" + minutes + ":" + seconds;
    }
  },
};
</script>
<style scoped>
.Header {
  /* height: 72px;
  position: relative;
  top: -28px */
  height: 72px;
}
</style>